/**   
* @date 2016年3月10日 下午6:30:56
* @version V1.0   
*/
package edu.cn.app.web.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloController {

	@ResponseBody
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public Map<String, String> printWelcome(ModelMap model) {
		Map<String, String> qqqMap=new HashMap<String, String>();
		qqqMap.put("dsgfse", "fee");
		model.addAttribute("message", "Spring 3 MVC Hello World");
		return qqqMap;

	}

	@RequestMapping(value = "/hello/{name:.+}", method = RequestMethod.GET)
	public ModelAndView hello(@PathVariable("name") String name) {

		ModelAndView model = new ModelAndView();
		model.setViewName("hello");
		model.addObject("msg", name);

		return model;

	}

}
